<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: SNTP</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__sntp.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">Modules</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">SNTP<div class="ingroups"><a class="el" href="group__apps.html">Applications</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group__sntp__opts"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp__opts.html">Options</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9b300c6616de60524c85ea40bf70e2ba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga9b300c6616de60524c85ea40bf70e2ba">sntp_init</a> (void)</td></tr>
<tr class="separator:ga9b300c6616de60524c85ea40bf70e2ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8119fc2d1ff7ff6eba511cc9c7167488"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga8119fc2d1ff7ff6eba511cc9c7167488">sntp_stop</a> (void)</td></tr>
<tr class="separator:ga8119fc2d1ff7ff6eba511cc9c7167488"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3fe5254e5a056fca80802d9f26b9c3c5"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga3fe5254e5a056fca80802d9f26b9c3c5">sntp_enabled</a> (void)</td></tr>
<tr class="separator:ga3fe5254e5a056fca80802d9f26b9c3c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaae94fb2adadbf9667e9597f8a45bf120"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#gaae94fb2adadbf9667e9597f8a45bf120">sntp_setoperatingmode</a> (u8_t operating_mode)</td></tr>
<tr class="separator:gaae94fb2adadbf9667e9597f8a45bf120"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae66404a551d5cef420cf844a71356fae"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#gae66404a551d5cef420cf844a71356fae">sntp_getoperatingmode</a> (void)</td></tr>
<tr class="separator:gae66404a551d5cef420cf844a71356fae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac8097829a81cb6f37d9acf8efb2cc82e"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#gac8097829a81cb6f37d9acf8efb2cc82e">sntp_getreachability</a> (u8_t idx)</td></tr>
<tr class="separator:gac8097829a81cb6f37d9acf8efb2cc82e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4fa038dcea66349fafdbe1cc3e52ff3a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga4fa038dcea66349fafdbe1cc3e52ff3a">sntp_setserver</a> (u8_t idx, const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *server)</td></tr>
<tr class="separator:ga4fa038dcea66349fafdbe1cc3e52ff3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2a28523cb9f2b5b025a4818bc2c1afc1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sntp.html#ga2a28523cb9f2b5b025a4818bc2c1afc1">sntp_getserver</a> (u8_t idx)</td></tr>
<tr class="separator:ga2a28523cb9f2b5b025a4818bc2c1afc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This is simple "SNTP" client for the lwIP raw API. It is a minimal implementation of SNTPv4 as specified in RFC 4330.</p>
<p>For a list of some public NTP servers, see this link: <a href="http://support.ntp.org/bin/view/Servers/NTPPoolServers">http://support.ntp.org/bin/view/Servers/NTPPoolServers</a></p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga3fe5254e5a056fca80802d9f26b9c3c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3fe5254e5a056fca80802d9f26b9c3c5">&#9670;&nbsp;</a></span>sntp_enabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8_t sntp_enabled </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get enabled state. </p>

</div>
</div>
<a id="gae66404a551d5cef420cf844a71356fae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae66404a551d5cef420cf844a71356fae">&#9670;&nbsp;</a></span>sntp_getoperatingmode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8_t sntp_getoperatingmode </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Gets the operating mode. </p>

</div>
</div>
<a id="gac8097829a81cb6f37d9acf8efb2cc82e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac8097829a81cb6f37d9acf8efb2cc82e">&#9670;&nbsp;</a></span>sntp_getreachability()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8_t sntp_getreachability </td>
          <td>(</td>
          <td class="paramtype">u8_t&#160;</td>
          <td class="paramname"><em>idx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Gets the server reachability shift register as described in RFC 5905.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">idx</td><td>the index of the NTP server </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga2a28523cb9f2b5b025a4818bc2c1afc1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2a28523cb9f2b5b025a4818bc2c1afc1">&#9670;&nbsp;</a></span>sntp_getserver()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a>* sntp_getserver </td>
          <td>(</td>
          <td class="paramtype">u8_t&#160;</td>
          <td class="paramname"><em>idx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Obtain one of the currently configured by IP address (or DHCP) NTP servers</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">idx</td><td>the index of the NTP server </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>IP address of the indexed NTP server or "ip_addr_any" if the NTP server has not been configured by address (or at all). </dd></dl>

</div>
</div>
<a id="ga9b300c6616de60524c85ea40bf70e2ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9b300c6616de60524c85ea40bf70e2ba">&#9670;&nbsp;</a></span>sntp_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sntp_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize this module. Send out request instantly or after <a class="el" href="group__sntp__opts.html#ga22017d43da7d4bf8d42e786b4ced4dfa">SNTP_STARTUP_DELAY(_FUNC)</a>. </p>

</div>
</div>
<a id="gaae94fb2adadbf9667e9597f8a45bf120"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaae94fb2adadbf9667e9597f8a45bf120">&#9670;&nbsp;</a></span>sntp_setoperatingmode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sntp_setoperatingmode </td>
          <td>(</td>
          <td class="paramtype">u8_t&#160;</td>
          <td class="paramname"><em>operating_mode</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the operating mode. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">operating_mode</td><td>one of the available operating modes </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga4fa038dcea66349fafdbe1cc3e52ff3a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4fa038dcea66349fafdbe1cc3e52ff3a">&#9670;&nbsp;</a></span>sntp_setserver()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sntp_setserver </td>
          <td>(</td>
          <td class="paramtype">u8_t&#160;</td>
          <td class="paramname"><em>idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *&#160;</td>
          <td class="paramname"><em>server</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize one of the NTP servers by IP address</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">idx</td><td>the index of the NTP server to set must be &lt; SNTP_MAX_SERVERS </td></tr>
    <tr><td class="paramname">server</td><td>IP address of the NTP server to set </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga8119fc2d1ff7ff6eba511cc9c7167488"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8119fc2d1ff7ff6eba511cc9c7167488">&#9670;&nbsp;</a></span>sntp_stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sntp_stop </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Stop this module. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
